home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / CD32 / CD32_Support / notes / Periph_Compat < prev   
Encoding:
Text File  |  1993-10-18  |  7.4 KB  |  170 lines

  1.  
  2.          CD32 Titles and CD32-Compatible Peripherals
  3.  
  4. Workbench 3.1 includes disk-loadable versions of the CD32 modules
  5. libs/nonvolatile.library, libs/lowlevel.library, and l/CDFileSystem.
  6. Included on this disk is a beta devs/cd.device, a disk-loadable version
  7. of the CD32 cd.device which talks to a peripheral SCSI2 CD-ROM drive.
  8.  
  9. With these software modules on an AGA Amiga system (A4000, A1200)
  10. equipped with SCSI2 CD-ROM drive, it should be possible to run many
  11. CD32 titles.  There may be future Commodore peripherals with these
  12. CD32 modules in an onboard ROM.  However, since these CD32-specific
  13. modules are disk-based, the user will probably need to boot into
  14. Workbench and then start your title from a Workbench icon.  To make
  15. this possible, you must provide an icon for your CD-ROM application, and
  16. you must be able to start up and function properly from that icon.
  17.  
  18. Please bear in mind that someone who wishes to run your title
  19. on a peripheral CD-ROM with soft-loaded libraries might not have
  20. a game controller input device.
  21.  
  22. ----------------------------------------------------------------------
  23. NOTE!!!  If your CD32 application is not multitasking friendly,
  24. or can not run safely and exit cleanly back to Workbench, your icon
  25. startup procedure should warn the user that your application will take
  26. over the system and/or will not exit, and at that point should give
  27. them a chance to OK or CANCEL the startup of your application.
  28. One way to accomplish this: use c:RequestChoice to present a
  29. requester to the user, and continue or quit your script based
  30. on their response. 
  31. ----------------------------------------------------------------------
  32.  
  33. The following describes methods for starting your title from a Workbench
  34. icon.
  35.  
  36. For an AmigaCD application to work on an Amiga computer (A4000 for
  37. example), the application should first be "OS friendly".  Secondly, it is
  38. always desirable that the application have a way to exit the program (and
  39. exit cleanly).  Thirdly, the application should be runnable from WorkBench.
  40. This can be done in a few ways:
  41.  
  42. The first thing that is necessary is that the disk contain an application
  43. icon.  When the application disk is inserted into the CD-ROM drive, a disk
  44. icon will appear on the WorkBench.  When the user double-clicks on your
  45. application's disk icon, a window will appear and your application's icon
  46. should be contained within it.  You should make sure that this window is
  47. sized to the appropriate size to display all icons on your CD that you want
  48. the user to see.  The only icon that you will probably want the user to see
  49. is the application's icon itself.  This is nothing new to Amiga developers.
  50. This is no different than if you were developing a floppy based
  51. application.
  52.  
  53. When your application's icon is double-clicked, your application should
  54. begin running.  This can be done in one of two ways.  The traditional
  55. method for running a program from the WorkBench is to make your application
  56. "WorkBench friendly".  In order to do this, your application must be able
  57. to deal with the WorkBench startup message (see the Amiga Technical
  58. Reference Manuals for information on how to do this).  The other option is
  59. to use the program supplied with this package named "MyGame" (which you
  60. will want to rename to your application's name).  This is a
  61. WorkBench-friendly program that simply runs a script file.  By running a
  62. script file, you have much more control over the environment that your
  63. application will be running.  An example script file (called cd-startup) is
  64. included and looks like this:
  65.  
  66.  
  67. ;   Example cd-startup file executed when the application's icon
  68. ;   residing on the application's CD is double-clicked.
  69.  
  70. Assign >NIL: SYS:  CD0:     add    ; Multi-Assign primary directories
  71. Assign >NIL: C:    CD0:C    add
  72. Assign >NIL: L:    CD0:L    add
  73. Assign >NIL: S:    CD0:S    add
  74. Assign >NIL: DEVS: CD0:DEVS add
  75. Assign >NIL: LIBS: CD0:LIBS add
  76.  
  77. stack 4096                         ; Make sure your stack size is big enough
  78. cd CD0:                            ; CD to the CD (if necessary)
  79. CD0:MyApplication                  ; Run your application
  80.  
  81. Assign >NIL: SYS:  CD0:     remove ; Remove multi-assignments
  82. Assign >NIL: C:    CD0:C    remove
  83. Assign >NIL: L:    CD0:L    remove
  84. Assign >NIL: S:    CD0:S    remove
  85. Assign >NIL: DEVS: CD0:DEVS remove
  86. Assign >NIL: LIBS: CD0:LIBS remove
  87.  
  88.  
  89.  
  90. The MyGame program knows which script file to run by the "Tool Type"
  91. assigned to the icon.  You can set this by clicking once on the MyGame icon
  92. from WorkBench, then by holding down the right mouse button select
  93. "Information" under the "Icon" heading of the menu bar.  Under the "Tool
  94. Types" area you will see "CD0:s/cd-startup".  This is where the MyGame
  95. program gets the file name of the script to run.
  96.  
  97. As an over-simplified example, lets say you have an application called
  98. "Lemmings".  Your CD would contain (at least) the following files:
  99.  
  100.      s (dir)
  101.        startup-sequence     - Executed when booting from an AmigaCD
  102.        cd-startup           - Executed when running from WorkBench
  103.  
  104.   Lemmings                  - Workbench program that runs a custom script
  105.                               (formerly MyGame)
  106.   Lemmings.info             - Your application's icon for previous program
  107.                               (formerly MyGame.info)
  108.   Lemmings.ld               - Actual application program
  109.  
  110.  
  111.  
  112. ----------------------------------------------------------------------------
  113.  
  114. Your startup-sequence file might look something like this:
  115.  
  116. ;   startup-sequence
  117.  
  118. stack 4096
  119. CD0:Lemmings.ld
  120.  
  121.  
  122. ----------------------------------------------------------------------------
  123.  
  124. Your cd-startup file might look something like this:
  125.  
  126. ;   Example cd-startup file executed when the application's icon
  127. ;   residing on the application's CD is double-clicked.
  128.  
  129. Assign >NIL: SYS:  CD0:     add     ; Multi-Assign primary directories
  130. Assign >NIL: C:    CD0:C    add     ; (only if they exist of course)
  131. Assign >NIL: L:    CD0:L    add
  132. Assign >NIL: S:    CD0:S    add
  133. Assign >NIL: DEVS: CD0:DEVS add
  134. Assign >NIL: LIBS: CD0:LIBS add
  135.  
  136. stack 4096                          ; Make sure your stack size is big enough
  137. cd CD0:                             ; CD to the CD
  138. CD0:Lemmings.ld                     ; Run Lemmings
  139.  
  140. Assign >NIL: SYS:  CD0:     remove  ; Remove multi-assignments
  141. Assign >NIL: C:    CD0:C    remove
  142. Assign >NIL: L:    CD0:L    remove
  143. Assign >NIL: S:    CD0:S    remove
  144. Assign >NIL: DEVS: CD0:DEVS remove
  145. Assign >NIL: LIBS: CD0:LIBS remove
  146.  
  147. ----------------------------------------------------------------------------
  148.  
  149. Actually, in this simple example, if the program Lemmings.ld didn't access
  150. any files off of SYS:, C:, L:, S:, DEVS:, or LIBS:, the "Assign" statements
  151. would not be necessary.  Likewise, if any files that Lemmings.ld did
  152. accessed specified the device CD0:, then the "cd" statement would not be
  153. necessary.  In this example, the cd-startup file could look as simple as
  154. the startup-sequence file.
  155.  
  156. Of course, you wouldn't want to do any assigns to directories that didn't
  157. exist on the CD.
  158.  
  159.  
  160. To summarize:
  161.  
  162. When a title is booted on an AmigaCD32 system, the startup-sequence is
  163. executed which invokes the game.  When running a title on an AGA Amiga
  164. system, the title is executed by double-clicking on the disk icon of the CD
  165. from WorkBench, and then double-clicking on the application's icon.  If the
  166. MyGame program is used as the application's icon, then a secondary script
  167. will be run in place of the startup-sequence. This script is located by the
  168. "Tool Type" of the MyGame icon.
  169.  
  170.